package com.yeung.exam;

import java.util.Scanner;

public class 字符进制转换_58 {
    public static void main(String[] args) {
/*        System.out.println((int)'0');
        System.out.println((int)'<');
        System.out.println((char)61);
        System.out.println((int)'>');
       */
//        System.out.println((int)'?');
        int line = new Scanner(System.in).nextInt();
        StringBuilder sb=new StringBuilder();
        while (true){
            int x=line%27;
            int y=line/27;
            if(y!=0){
                sb.append(y);
                line=x;
            }else{
                sb.append((char)(x+37));
                break;
            }
        }
        System.out.println(sb.toString());
    }
}
